<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <title>三岁博客后台管理-主题管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="icon" href="../../static/images/favicon.ico" th:href="@{/images/favicon.ico}"/>
    <link rel="stylesheet" href="../../static/lib/admin/lib/layui-v2.6.3/css/layui.css"
          th:href="@{/lib/admin/lib/layui-v2.6.3/css/layui.css}" media="all">
    <link rel="stylesheet" href="../../static/lib/admin/css/public.css" th:href="@{/lib/admin/css/public.css}"
          media="all">
</head>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">

        <form class="layui-form layui-form-pane">
            <div class="layui-form-item">
                <label class="layui-form-label">主题名称</label>
                <div class="layui-input-inline">
                    <input type="text" name="realName" id="realName" placeholder="" class="layui-input">
                </div>
                <div class="layui-inline">
                    <button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-search-btn"><i
                            class="layui-icon">&#xe615;</i> 搜 索
                    </button>
                    <button type="submit" class="layui-btn layui-btn-primary" lay-submit lay-filter="data-checked-btn">
                        <i class="layui-icon">&#xe615;</i> 获取选中数据
                    </button>
                </div>
            </div>
        </form>
        <table id="currentTableId"></table>

    </div>
</div>


<script src="../../static/lib/admin/lib/layui-v2.6.3/layui.js" th:src="@{/lib/admin/lib/layui-v2.6.3/layui.js}"
        charset="utf-8"></script>

<script>
    layui.config({
        base: '[[@{/lib/admin/lib/themes/}]]' //配置 layui 第三方扩展组件存放的基础目录
    }).extend({
        cardTable: 'cardTable/cardTable'
    }).use(['table', 'layer', 'form', 'jquery', 'cardTable'], function () {
        let table = layui.table;
        let form = layui.form;
        let $ = layui.jquery;
        let layer = layui.layer;
        let cardTable = layui.cardTable;

        cardTable.render({
            elem: '#currentTableId',
            url: '../page/getThemesList',
        })

        // 监听搜索操作
        form.on('submit(data-search-btn)', function (data) {
            queryJson = data.field;
            cardTable.reload("currentTableId", {
                where: queryJson,
            });
            return false;
        });

        form.on('submit(data-checked-btn)', function () {
            var data = cardTable.getChecked("currentTableId");
            layer.msg(JSON.stringify(data));
            return false;
        });
    })
</script>
</body>
</html>